<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<?php $resList = $this->resList; 
$prProduct = new Model_DbTable_Pr_Prproducts();
$total = 0;
$totalB = 0;

?>
<body style="font-family:Arial, Helvetica, sans-serif">
<h1><?php echo $this->idJob?><br />
  <br />
  To Shop ID:<?php echo $resList[0]["shop_code"]; ?> , On : <?php echo $resList[0]["date_move"]; ?> <?php echo $resList[0]["time_move"]; ?><br />
  By: <?php echo $resList[0]["staff_name"]; ?>
</h1>
<table width="650" border="1" cellspacing="0" cellpadding="5">
  <tr>
    <th scope="col">Code</th>
    <th scope="col">Description</th>
    <th scope="col">Qty</th>
    <th scope="col">RRP</th>
    <th scope="col">B Price</th>
  </tr>
  <?php foreach($resList as $key => $v){
	 if($v['code_move']!=9){  
	  ?>
 
  <tr>
    <td><?php 
    $pLine = $prProduct->getProduct($v["id_product"]);
    echo $pLine["code_product"];
    ?></td>
    <td style="font-size:12px;"><?php echo $pLine["title_product"]?></td>
    <td><?php 
	echo ($v['code_move']==6)?"- ":"";
	echo $v["qty_product"]?></td>
	<td align="right"><?php 
			if($v['code_move'] ==6){
				$cost = (0-$v['qty_product'])*$pLine['price_a'];
	 		}else{
	 			$cost = $v['qty_product']*$pLine['price_a'];
	 		}
			$total += $cost;
			echo $cost;?></td>
	<td align="right"><?php 
			if($v['code_move'] ==6){
				$costB = (0-$v['qty_product'])*$pLine['price_q'];
	 		}else{
	 			$costB = $v['qty_product']*$pLine['price_q'];
	 		}
			$totalB += $costB;
			echo $costB;?></td>
  </tr>
  <?php
	 }
  
   }?>
   <tr>
   	<td colspan = "4" align="right"><?php echo "Total:$ ".$total;?></td>
   	<td align="right"><?php echo "Total B:$ ".$totalB;?></td>
   </tr>
</table>

</body>
</html>
